
  
/**
 * 根据key获取value
 * @param optionArr
 * @param key
 */
export function getValue(optionArr, key) {
  let resultVal = "";
  if (!optionArr || optionArr.length === 0) {
    return resultVal;
  }
  optionArr.map(item => {
    if (item.type === key || item.key === key ) {
      resultVal = item.value || item.name ;
    }
  });
  return resultVal;
}

// 短信类型：register-注册，login-登录，passwd-设置密码，addcardowner-添加持卡人
export const SMS_TYPE = {
	"PASSWD":"passwd",
	"LOGIN":"login",
	"REGISTER":"register",
	"ADD_CARD_OWNER":"addcardowner",
}

// 图片类型 图片分类：COMMON-公共
export const IMG_TYPE = {
	"COMMON":"COMMON",
}
/**
 * 卡片类型：1-虚拟卡，2-实体卡
 */
export const CARD_TYPE = {
	"VIRTUAL":1,
	"PHYSICAL":2,
}

/**
 * 	余额流水类型：1-充值，2-支付，3-转入，4-转出
 * @type {[{value: string, key: string}]}
 */
export const BALANCE_TRANSACTION_TYPE = [
  {
    key: 1,
    value: "充值"
  },
  {
    key: 2,
    value: "支付"
  },
  {
    key: 3,
    value: "转入"
  },
  {
    key: 4,
    value: "转出"
  }
];

/**
 * 	状态：0-未结算，1-已结算
 * @type {[{value: string, key: string}]}
 */
export const COMMISSION_STATUS = [
  {
    key: 0,
    value: "未结算"
  },
  {
    key: 1,
    value: "已结算"
  }
];
/**
 * 	交易状态：SUCCESS-成功，FAIL-失败
 * @type {[{value: string, key: string}]}
 */
export const TRANS_STATUS = [
  {
    key: 'SUCCESS',
    value: "成功"
  },
  {
    key: 'FAIL',
    value: "失败"
  }
];
/**
 * 	充值状态：状态：0-处理中，1-充值成功，2-充值失败
 * @type {[{value: string, key: string}]}
 */
export const RECHARGE_STATUS = [
  {
    key: 0,
    value: "处理中"
  },
  {
    key: 1,
    value: "充值成功"
  },
  {
    key: 2,
    value: "充值失败"
  }
];

/**
 * 转账类别：1-钱包转账，2-卡内部转账，3-卡外部转账
 */
export const TRABSFER_TYPE = {
	"WALLET":1,
	"INTERNAL":2,
	"EXTERNAL":3,
}

/**
 * 	转账状态：0-申请中，1-转账中，2-转账成功，3-转账失败
 * @type {[{value: string, key: string}]}
 */
export const CARD_TRANSFER_STATUS = [
  {
    key: 0,
    value: "申请中",
  },
  {
    key: 1,
    value: "转账中"
  },
  {
    key: 2,
    value: "转账成功"
  },
  {
    key: 3,
    value: "转账失败"
  }
];